<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="block/block:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<form action="?block/block-edit.html" mini-form="block-form"  method="post" >
<input type="hidden" name="block_id" value="<{$detail.block_id}>"/>
<table width="100%" border="0" cellspacing="0" class="table-data form">
<tr>
    <th>名称：</th>
        <td>
            <input type="text" name="data[title]" value="<{$detail.title|default:''}>" class="input w-200"/>
            <span class="tip-comment">唯一供模板标签调用</span>
        </td>
    </tr>
<tr><th class="w-100">页面：</th>
    <td>
        <select name="data[page_id]" class="w-150"><{widget id="block/page" value=$detail.page}></select>
        <span class="tip-comment">分类显示用，并不影响在哪个模板中调用</span>
    </td>
</tr>
<tr><th>模型：</th><td><b class="blue"><{$detail.from_title}></b></td></tr>
<tr><th class="w-100">调用：</th>
    <td><select name="data[type]" class="w-150">
        <option value="default">默认排序</option>
        <option value="hot" <{if $detail.type=='hot'}>selected="selected"<{/if}>>热度优先</option>
        <option value="new" <{if $detail.type=='new'}>selected="selected"<{/if}>>最新优先</option>
        <option value="zhanwei" <{if $detail.type=='zhanwei'}>selected="selected"<{/if}>>占位符补充</option>
        <option value="only" <{if $detail.type=='only'}>selected="selected"<{/if}>>只接受推荐位</option>        
        </select>
        <span class="tip-comment">当推荐的数据不够时，补充数据方式</span>
    </td>
</tr>
<tbody id="type-zhanwei"<{if $detail.type !== 'zhanwei'}> style="display:none;"<{/if}>>
<tr><th>占位标题：</th><td><input type="text" name="zhanwei[title]" value="<{$detail.config.zhanwei.title}>" class="input w-300"/></td></tr>
<tr><th>占位链接：</th>
    <td>
        <input type="text" name="zhanwei[link]" value="<{$detail.config.zhanwei.link}>" class="input w-300"/>
        <span class="tip-comment">链接可为空</span>
    </td>
</tr>
<tr>
    <th>占位图片：</th>
    <td>
        <input type="text" name="zhanwei[thumb]" value="<{$detail.config.zhanwei.thumb}>" class="input w-200" />&nbsp;&nbsp;&nbsp;
        <input type="file" name="zhanwei_thumb" class="input w-100" />
    </td>
</tr>
</tbody>
<tbody id="type-only"<{if $detail.type == 'only' || $detail.type == 'zhanwei'}> style="display:none;"<{/if}>>
<{if $detail.from == 'article'}>
<tr><th>分类：</th>
    <td>
        <select name="data[config][cat_id][]" class="w-200" multiple="multiple" style="height:auto" size="10">
            <option value="">不限分类</option>
            <{widget id="article/cate" from='article' value=$detail.config.cat_id}>           
        </select>
        <span class="tip-comment">不选表示全部,按ctrl键可多选</span>
    </td>
</tr>
<{elseif $detail.from == 'shop'}>
<tr><th>分类：</th>
    <td>
        <select name="data[config][cat_id][]" class="w-200" multiple="multiple" style="height:auto" size="10">
            <option value="">不限分类</option>
            <{widget id="shop/cate" parent_id=0 value=$detail.config.cat_id}>
        </select>
        <span class="tip-comment">不选表示全部,按ctrl键可多选</span>
    </td>
</tr>
<{elseif $detail.from == 'product'}>
<tr><th class="w-100">筛选：</th>
    <td>
        <label><input name="data[config][onpayment]" type="checkbox" value="1" <{if $detail.config.onpayment}>checked="checked"<{/if}>/>可支付商品</label>&nbsp;&nbsp;
        <label><input name="data[config][sale_remai]" type="checkbox" value="1" <{if $detail.config.sale_remai}>checked="checked"<{/if}>/>热卖</label>&nbsp;&nbsp;
        <label><input name="data[config][sale_youhui]" type="checkbox" value="1" <{if $detail.config.sale_youhui}>checked="checked"<{/if}>/>优惠</label>&nbsp;&nbsp;
        <label><input name="data[config][sale_tuijian]" type="checkbox" value="1" <{if $detail.config.sale_tuijian}>checked="checked"<{/if}>/>推荐</label>&nbsp;&nbsp;
        <span class="tip-comment">不选表示不限制</span>
    </td>
</tr>
<tr><th>分类：</th>
    <td>
        <select name="data[config][cat_id][]" class="w-200" multiple="multiple" style="height:auto" size="10">
            <option value="">不限分类</option>
             <{widget id="shop/catetree" value=$detail.config.cat_id}>
        </select>
        <span class="tip-comment">不选表示全部,按ctrl键可多选</span>
    </td>
</tr>
<{elseif $detail.from == 'company'}>
<tr><th class="w-100">筛选：</th>
    <td>
        <label><input name="data[config][xiaobao]" type="checkbox" value="1" <{if $detail.config.xiaobao}>checked="checked"<{/if}>/>消保</label>&nbsp;&nbsp;
        <label><input name="data[config][verify_name]" type="checkbox" value="1" <{if $detail.config.verify_name}>checked="checked"<{/if}>/>认证</label>&nbsp;&nbsp;
        <label><input name="data[config][is_vip]" type="checkbox" value="1" <{if $detail.config.xiaobao}>checked="checked"<{/if}>/>旗舰</label>&nbsp;&nbsp;
        <span class="tip-comment">不选表示不限制</span>
    </td>
</tr>
<{/if}>
<{if $detail.from == 'company' || $detail.from == 'shop' || $detail.from == 'designer' || $detail.from == 'gz'}>
<tr><th>等级：</th>
    <td>
        <select name="data[config][group_id][]" class="w-200" multiple="multiple" style="height:auto" size="8">
            <option value="">不限分类</option>
            <{widget id="member/group" from=$detail.from value=$detail.config.group_id}>
        </select>
        <span class="tip-comment">不选表示全部,按ctrl键可多选</span>
    </td>
</tr>
<tr><th class="w-100">口碑值：</th>
    <td>
        <input name="data[config][score]" type="text" class="input w-100" value="<{$detail.config.score|default:0}>"/>
        <span class="tip-comment">口碑值高于多少, 0:不限</span>   
    </td>
</tr>
<{/if}>
</tbody>
<tr><th class="w-100">调用条数：</th>
    <td>
        <input name="data[limit]" type="text" class="input w-100" value="<{$detail.limit}>"/>
        <span class="tip-comment">最多调用内容条数</span>   
    </td>
</tr>
<tr><th>缓存周期：</th><td><select name="data[ttl]" class="w-100"><{widget id="data/ttl" value=$detail.ttl}></select></td></tr>
<tr><th>排序：</th><td><input type="text" name="data[orderby]" value="<{$detail.orderby|default:'50'}>" class="input w-50"/></td></tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form>
</div>
<script type="text/javascript">
(function(K, $){
    $("[name='data[type]']").change(function(){
        if($(this).val() == 'only'){
            $("#type-only").hide();
            $("#type-zhanwei").hide();
        }else if($(this).val() == 'zhanwei'){
            $("#type-only").hide();
            $("#type-zhanwei").show();           
        }else{
            $("#type-only").show();
        }
    });
})(window.KT, window.jQuery);
</script>
<{include file="admin:common/footer.html"}>